package com.example.limit.entity;

import java.time.LocalDateTime;

public class PurchaseRule {
    private Long id;
    private String ruleName;
    private Integer ruleType; // 1:用户维度 2:商品维度 3:时间维度 4:订单维度
    private Integer subType; // 子类型: 1:单用户限购 2:新老用户 3:单品限购 4:品类限购 5:时间段限购 6:单订单限购 7:多订单累计
    private Integer limitQuantity;
    private String targetValue; // 目标值: 用户ID、商品ID、品类ID等
    private LocalDateTime startTime;
    private LocalDateTime endTime;
    private Integer status; // 0:禁用 1:启用
    private Integer priority; // 优先级，数值越小优先级越高
    private Long groupId; // 规则组ID，同一组的规则可以组合
    private Integer groupLogic; // 组内逻辑: 1:AND 2:OR
    private String matchCondition; // 匹配条件，JSON格式，支持复杂条件
    private LocalDateTime createTime;
    private LocalDateTime updateTime;

    // getters and setters
    public Long getId() { return id; }
    public void setId(Long id) { this.id = id; }
    public String getRuleName() { return ruleName; }
    public void setRuleName(String ruleName) { this.ruleName = ruleName; }
    public Integer getRuleType() { return ruleType; }
    public void setRuleType(Integer ruleType) { this.ruleType = ruleType; }
    public Integer getSubType() { return subType; }
    public void setSubType(Integer subType) { this.subType = subType; }
    public Integer getLimitQuantity() { return limitQuantity; }
    public void setLimitQuantity(Integer limitQuantity) { this.limitQuantity = limitQuantity; }
    public String getTargetValue() { return targetValue; }
    public void setTargetValue(String targetValue) { this.targetValue = targetValue; }
    public LocalDateTime getStartTime() { return startTime; }
    public void setStartTime(LocalDateTime startTime) { this.startTime = startTime; }
    public LocalDateTime getEndTime() { return endTime; }
    public void setEndTime(LocalDateTime endTime) { this.endTime = endTime; }
    public Integer getStatus() { return status; }
    public void setStatus(Integer status) { this.status = status; }
    public LocalDateTime getCreateTime() { return createTime; }
    public void setCreateTime(LocalDateTime createTime) { this.createTime = createTime; }
    public Integer getPriority() { return priority; }
    public void setPriority(Integer priority) { this.priority = priority; }
    public Long getGroupId() { return groupId; }
    public void setGroupId(Long groupId) { this.groupId = groupId; }
    public Integer getGroupLogic() { return groupLogic; }
    public void setGroupLogic(Integer groupLogic) { this.groupLogic = groupLogic; }
    public String getMatchCondition() { return matchCondition; }
    public void setMatchCondition(String matchCondition) { this.matchCondition = matchCondition; }
    public LocalDateTime getUpdateTime() { return updateTime; }
    public void setUpdateTime(LocalDateTime updateTime) { this.updateTime = updateTime; }
}